package com.itheima.sc.config;

import com.itheima.sc.result.Result;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlogException {
    @ExceptionHandler(value = ComException.class)
    public Result method(ComException e){
        return Result.error(e.getMessage());
    }
}
